{extend name="template/base_default"}
{block name="header"}
<link rel="stylesheet" href="__CSS__/common.css">
<link rel="stylesheet" href="__CSS__/weui.min.css">
<link rel="stylesheet" href="__CSS__/index.css">
<link rel="stylesheet" href="__CSS__/weuix.min.css"/>
<script src="__JS__/zepto.min.js"></script>
<script src="__JS__/lrz.min.js"></script>
<style>

    .form-head{
        color: white;
        font-size: 16px;
        background-color: rgba(95, 110, 170, 0.4);
        border-radius: 5px;
        overflow: hidden;
        color:white;
    }
    body{
        background-image:url("__IMG__/bj.png");
        background-repeat:no-repeat;
        background-size:cover;
        text-align: center;
        background-attachment:fixed;
    }
    .body-input{
        color: #dddddd;
        position: relative;
        outline: none;
        border: solid 1px #ffffff;
        background-color: rgba(95, 110, 170, 0.4);
        float: left;
        margin: auto;
        font-size: 16px;
        height: 41px;
        line-height: 41px;
        border-radius: 5px;
        width: 60%;
        font-family: "Microsoft YaHei UI";
    }
    .bottom-btn{
        width:50%;
        height:100%;
        float: left;
    }
    button{
        border: none;
        color:white;
    }
    .botton1{
        background-color: #FF0000;

    }
    .botton2{
        background-color: #131a34;
        width:100%;
    }
    .input-window{
        margin-left: auto;
        margin-right: auto;
        background-color: white;
        width:90%;
        height:150px;
        background-color: rgba(95, 110, 170, 0.4);
        border-radius: 10px;
        margin-top: 30px;
        margin-left: 20px;
        text-align: center;
        clear:both;
        position: relative;
    }
    .aa{
        height:3px;
        background-color: white;
        width:40px;
        position:absolute;
        top: 30px;
        left:55px;
    }
    .bb{

        opacity: 0;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        z-index:99;
        width:300px;
        position:absolute;
        top:0;
        left:0;
        height:140px;
    }
    li{
        list-style:none;
    }
    .store-box{

        height:90px;
        margin-top: 30px;
        width: 90%;
        color:#545454;
    }
    .store-box img {
        width:100px;
        height:100px;
        float:right;
        margin-right: 10px;
        margin-top: 10px;
    }
    .store-success{
        font-size: 18px;
        color:#545454;

        font-family: "Microsoft YaHei UI";
    }
    .store-text{
        float: left;
        margin-top: 30px;
        margin-left: 16px;
        text-align: left;

    }
    .store-detail{
        font-size: 14px;
        color:#8c8c8c;
        font-family: "Microsoft YaHei UI";
        margin-top: 12px;
    }
    .store-p{
        text-align: center;
        color:white;
        margin-top: 30px;
        font-family: "Microsoft YaHei UI";
        font-size: 18px;

    }
    .store-other {
        margin-top: 20px;
        margin-left: auto;
        margin-right: auto;
        height:80px;
        background-color: rgba(95, 110, 170, 0.4);
        border-radius: 10px;
        width:90%;
        margin-left: 20px;
        margin-top: 20px;

        float: left;
        line-height: 80px;
        text-align: center;

    }
    .store-other2 {
        margin-top: 20px;
        margin-left: auto;
        margin-right: auto;
        height:80px;
        background-color: white;
        border-radius: 10px;
        width:40%;
        margin-left: 20px;
        margin-top: 20px;

        float: left;
        line-height: 80px;
        text-align: center;
    }
    .form-head2{
        color: white;
        font-size: 16px;
        background-color: rgba(95, 110, 170, 0.4);
        border-radius: 5px;
        overflow: hidden;
        height:420px;
        float: left;
        width:100%;
        margin-top: 20px;
    }
    .store-other-img{
        width:50px;
        float: left;
        height:50px;
        margin-top: 14px;
        margin-left: 14px;
        border-radius: 10px;
    }
    .form-head2 input{
        width:10%;
        height:20px;
        line-height: 30px;
        margin-top: 20px;
        margin-left: 40px;

    }
    .bank{
        width:100%;
        height:50px;
        line-height: 30px;
        text-align: left;
        font-size: 16px;
        margin-left: 30px;
    }
    .form-input3-input{
        width:50%;

        height:30px;
        margin-top: 10px;
        line-height: 24px;
        padding: 10px;
    }
    .form-input3{
        height:42px;
    }
</style>
{/block}
{block name="body"}

<form action="{:url('login/register')}" method="post" style="width:95%;margin: auto;margin-top: 20px">
    <div class="form-head">
        <div class="form-input3" >
            <label for="name" class="form-input3-label">姓名:</label>
            <input class="form-input3-input" id="name" name="name" type="text" value="" placeholder=" ">
        </div>
        <div class="form-input3">
            <label for="idcard_number" class="form-input3-label">身份证:</label>
            <input class="form-input3-input" name="idcard_number" id="idcard_number" type="text" value="">
        </div>
        <div class="form-input3">
            <label for="name" class="form-input3-label">手机号:</label>
            <input class="form-input3-input" id="mobile" name="mobile" type="text" value="" placeholder="">
        </div>
    </div>
    <div class="form-head" style="margin-top: 20px">
        <div class="form-input3">
            <label for="account_mobile" class="form-input3-label">账号:</label>
            <input class="form-input3-input" name="account_mobile" id="account_mobile" type="text" value="">
        </div>
        <div class="form-input3">
            <label for="name" class="form-input3-label">密码:</label>
            <input class="form-input3-input" id="account_psw" name="account_psw" type="text" value="" placeholder="">
        </div>
    </div>
    <div class="input-window" style="background-size:cover;width:80%;margin-left:auto;margin-right:auto;">
        <img style="margin-top: 30px;height:30px;width:30px;margin-left: auto;margin-right: auto;margin-left: 2%" src="__IMG__/jia.png">
        <p style="color:white">上传身份证正面</p>
        <input class="bb headimgurl" style="width:100%" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"   />
        <input  type="hidden"  id="idcard_front"  value="" />
    </div>
    <div class="input-window" style="background-size:cover;width:80%;margin-left:auto;margin-right:auto;">
        <img style="margin-top: 30px;height:30px;width:30px;margin-left: auto;margin-right: auto;margin-left: 2%" src="__IMG__/jia.png">
        <p style="color:white">上传身份证反面</p>
        <input class="bb headimgurl" style="width:100%" type="file" accept="image/jpg,image/jpeg,image/png,image/gif"   />
        <input  type="hidden"  id="idcard_back"  value="" />
    </div>
    <div class="form-head2" style="background-size:cover;margin-bottom: 20px;float: left">
        <div class="form-input3" style="height:60px;">
            <label style="color:white" for="name" class="form-input3-label">银行卡号:</label>
            <input class="form-input3-input" style="margin-top:10px;float:left;border:solid 1px white;color:white;width:54%;height:36px;margin-left: 6px" class="form-input3-input" id="bank_card_no" name="bank_card_no" type="text" value="" placeholder=" ">
        </div>
        <label for="nongye"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="nongye" value="中国农业银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/1.png"> </div></label>
        <label for="jiaotong"><div class="bank"><input  style="margin-left: 26px;position:relative;bottom: 8px"  type="radio" name="bank" id="jiaotong" value="中国交通银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/2.png"></div></label>
        <label for="jiaotong"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="gongshang" value="中国工商银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/3.png"></div></label>
        <label for="minsheng"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="minsheng" value="中国银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/4.png"></div></label>
        <label for="jianshe"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="jianshe" value="中国建设银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/5.png"></div></label>
    </div>
    <div style="position:fixed;bottom:0;left:0;width:100%;height:50px;z-index: 120;">

        <button id="submit" class="bottom-btn botton2" type="button">提交</button>
    </div>
</form>
<div style="float:left;height:50px;margin-top: 10px;width: 100%;"></div>
{/block}
{block name="footer"}
<script type="text/javascript" src="__JS__/public.js"></script>
<script>
    $(function(){

        $('.headimgurl').change(function () {
            var v_this = $(this);
            lrz(this.files[0],{width:640,fieldName:"image"}).then(function (rst) {
                var formdata = new FormData();
                v_this.parent().css("background-image","url("+rst.base64+")");//无论是否上传成功都显示
                url = "__BASE__/web.php/file/upload_picture_base64";
                formdata.append("image", rst.base64);
                $.ajax({
                    url : url,
                    type : 'post',
                    data : formdata,
                    contentType : false,
                    processData : false,
                    dataType : "json",
                    success : function(data) {
                        if (data.status == true) {
                            $.toast("图片上传成功");
                            v_this.next().val(data.info[0]['id']);
                        }
                    },
                    error:function(){
                        $.toast("图片上传失败");
                    }
                });
                return false;
            })
        });
    })
    $('#submit').click(function () {
        if($('#account_mobile').val() == "" && $('#account_mobile').val().length != 11){
            $.toast("用户名必须为11位手机号",'cancel');
        }
        if($('#account_psw').val().length<6){
            $.toast("密码长度不可以小于6位",'cancel');
        }
        if(!$('#mobile').val()||isNaN($('#mobile').val())||$('#mobile').val().length != 11){
            $.toast("输入11位手机号",'cancel');
        }else{
            var body  ={
                platform_id:"{$platform_id}",
                name:$('#name').val(),
                idcard_number:$('#idcard_number').val(),
                bank_card_no:$('#bank_card_no').val(),
                mobile:$('#mobile').val(),
                idcard_front:$('#idcard_front').val(),
                idcard_back:$('#idcard_back').val(),
                account_mobile:$('#account_mobile').val(),
                account_psw:$('#account_psw').val(),
                bank_card_name:$('input[name="bank"]:checked').val()
            };
            var $this = $(this);
            $this.addClass('weui-btn_disabled').attr('disabled','disabled');
            ajax_post(getBaseUrl()+'/web.php/extension/add_person',jQuery.param(body),{
                success:function(data){
                    $.toast("申请成功 请耐心等待结果",'success');
                    $this.removeClass('weui-btn_disabled').removeAttr("disabled");
                    setTimeout(
                        function(){
                            history.back(-1);
                        }
                        ,1500);
                },
                error:function(data){
                    $.toptip('申请失败', 'error');
                    $this.removeClass('weui-btn_disabled').removeAttr("disabled");
                }
            })
        }

    });
</script>
{/block}